import React, { Component }  from 'react';
import './index.less'

/**
 * 面板组件
 */
class Panel extends Component {
	static defaultProps = {
		titleHeight: '5vh',
		bodyHeight: '20vh',
		additional: ''
	};

	constructor(props) {
		super(props);
		this.state = {};
	}

	static getDerivedStateFromProps(nextProps, prevState) {

		return null;
	}

	render() {
		const { children, title } = this.props;

		return (
			<div className={'screen-panel'}>
				<div className="screen-panel-title">
				    <span className="screen-panel-title-main">
					    <span className="screen-panel-title-text">{title}</span>
					    <span className="title-line" />
				    </span>
				</div>
				<div className={'screen-panel-body'}>
					{children}
				</div>
			</div>
		);
	}
}

export default Panel;
